<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            "http://www.w3.org/TR/html4/strict.dtd">

<jsp:directive.page errorPage="/WEB-INF/mayberry/ErrorPage.jsp"/>
<jsp:directive.page import="org.twnmayberry.dto.*"/>
<jsp:directive.page import="java.text.SimpleDateFormat"/>
<html>
    <title>Display POI</title>
    <body>

        <jsp:scriptlet>
            POIDTO person = (POIDTO)request.getAttribute("result");
        </jsp:scriptlet>

        Id: <%= person.getId() %><p/>
        First Name: <%=person.getFirstName()%><p/>
        Middle Name: <%=person.getMiddleName()%><p/>
        Last Name: <%=person.getLastName()%><p/>
        
        Height: <%= person.getHeight() %><p/>
        Weight: <%= person.getWeight() %><p/>
        Gender: <%= person.getGender().name() %><p/>
        
        Aliases:
        <ul>
          <jsp:scriptlet>
                for(Object o: person.getAliases()) {
                    POIDTO alias = (POIDTO)o;
                    String url = "?id=" + alias.getId() + "&amp;command=Get+POI";
            </jsp:scriptlet>
                <li><a href="<%= url %>"><%= alias.getId() %>: <%= alias.getFirstName() %> <%= alias.getMiddleName() %> <%= alias.getLastName() %></li>
            <jsp:scriptlet>
                }
          </jsp:scriptlet>
        </ul>
         Activities:
         <table>
         <thead><tr><th>Date</th><th>type</th><th>Description</th></tr></thead><tbody>
          <jsp:scriptlet>
                SimpleDateFormat formater = new SimpleDateFormat("MM/dd/yyyy");
                for(Object o: person.getActivities()) {
                    ActivityDTO act = (ActivityDTO)o;
            </jsp:scriptlet>
                <tr><td><%= formater.format(act.getDate()) %></td><td><%= act.getType().name() %></td><td><%= act.getDescription() %></td>
            <jsp:scriptlet>
                }
          </jsp:scriptlet>
          </tbody>
        </table>

        <p/><a href="<%=request.getContextPath()%>/index.jsp">Go to Main Page</a>
    </body>
</html>